﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using WeifenLuo.WinFormsUI.Docking;
using UtilityLibrary.WinControls;
namespace CSharpGo
{
    public partial class Frm_MainToolWindow : DockContent
    {
        
         private void InitializeOutlookbar()
        {
     
            #region 

            foreach (string strModule in Frm_Main.m_dicFormText2FormTypeName.Keys)
            {
                OutlookBarBand outlookShortcutsBand = new OutlookBarBand(strModule);
                outlookShortcutsBand.SmallImageList = this.imageList;
                outlookShortcutsBand.LargeImageList = this.imageList;
                int nImageIndex = 0;
                foreach (string strItem in Frm_Main.m_dicFormText2FormTypeName[strModule].Keys)
                {
                    outlookShortcutsBand.Items.Add(new OutlookBarItem(strItem, nImageIndex++));
                    outlookShortcutsBand.Background = SystemColors.AppWorkspace;
                    outlookShortcutsBand.TextColor = Color.White;
                    
                }

                outlookBar1.Bands.Add(outlookShortcutsBand);
            }

           


            //OutlookBarBand outlookShortcutsBand4 = new OutlookBarBand("订单管理");
            //outlookShortcutsBand4.SmallImageList = this.imageList;
            //outlookShortcutsBand4.LargeImageList = this.imageList;
            //outlookShortcutsBand4.Items.Add(new OutlookBarItem("订单管理", 0));



            //outlookShortcutsBand4.Background = SystemColors.AppWorkspace;
            //outlookShortcutsBand4.TextColor = Color.White;
            //outlookBar1.Bands.Add(outlookShortcutsBand4);


            //OutlookBarBand outlookShortcutsBand2 = new OutlookBarBand("财务管理");
            //outlookShortcutsBand2.SmallImageList = this.imageList;
            //outlookShortcutsBand2.LargeImageList = this.imageList;
            //outlookShortcutsBand2.Items.Add(new OutlookBarItem("充值管理", 0));



            //outlookShortcutsBand2.Background = SystemColors.AppWorkspace;
            //outlookShortcutsBand2.TextColor = Color.White;
            //outlookBar1.Bands.Add(outlookShortcutsBand2);


            //OutlookBarBand outlookShortcutsBand3 = new OutlookBarBand("库房管理");
            //outlookShortcutsBand3.SmallImageList = this.imageList;
            //outlookShortcutsBand3.LargeImageList = this.imageList;
            //outlookShortcutsBand3.Items.Add(new OutlookBarItem("入库管理", 0));



            //outlookShortcutsBand3.Background = SystemColors.AppWorkspace;
            //outlookShortcutsBand3.TextColor = Color.White;
            //outlookBar1.Bands.Add(outlookShortcutsBand3);
             
            #endregion





         
         

            //#endregion
            outlookBar1.Dock = DockStyle.Fill;
            outlookBar1.SetCurrentBand(0);
      
            outlookBar1.ItemClicked += new OutlookBarItemClickedHandler(OnOutlookBarItemClicked);
            outlookBar1.ItemDropped += new OutlookBarItemDroppedHandler(OnOutlookBarItemDropped);

            //outlookBar1.FlatArrowButtons = true;
            this.panel1.Controls.AddRange(new Control[] { outlookBar1 });
        }
         
        private void OnOutlookBarItemClicked(OutlookBarBand band, OutlookBarItem item)
        {
            Frm_Main.GetMainForm().ShowContent(item.Text);
            //switch (item.Text)
            //{
            //    #region 资料管理
            //    case "工厂管理":
            //        {
            //            Frm_Main.GetMainForm().ShowContent(item.Text);
                        
            //        }
            //        break;


            //    #endregion

            //    #region 业务管理
            //    case "派单管理":
            //        Frm_Main.GetMainForm().ShowContent(item.Text);
            //        break;
            //    case "商检装箱单":
            //        Frm_Main.GetMainForm().ShowSJFillBoxSheetForm();
            //        break;
            //    case "商检合同及发票":
            //        Frm_Main.GetMainForm().ShowSJContractForm();
            //        break;
            //    case "购货合同草稿":
            //        Frm_Main.GetMainForm().ShowSJBuyGoodsForm();
            //        break;
            //    case "报关装箱单":
            //        Frm_Main.GetMainForm().ShowSJBuyGoodsForm();
                    
            //        break;
            //    #endregion



            //    default:
            //        break;
            //}
        }

         private void OnOutlookBarItemDropped(OutlookBarBand band, OutlookBarItem item)
         {
             //            string message = "Item : " + item.Text + " was dropped";
             //            MessageBox.Show(message);            
         }
         public Frm_MainToolWindow()
        {
            
            InitializeComponent();
            InitializeOutlookbar();
        }

         private void Frm_MainToolWindow_Load(object sender, EventArgs e)
         {

         }
    }
}
